package mcia_gui;

import java.io.File;
import javax.swing.filechooser.*;

/**
 * MyCustomFilter2.java - allows to open only *.zip files with fileChooser2 in AdmAddFile.java.
 *
 * @author MCIA
 */
public class MyCustomFilter2 extends FileFilter {

    @Override
        public boolean accept(File file) {
            // Allow only directories, or files with ".zip" extension
            return file.isDirectory() || file.getAbsolutePath().endsWith(".zip");
        }
        @Override
        public String getDescription() {
            // This description will be displayed in the dialog,
            return "Text documents (*.zip)";
        }
}